package com.szx.usercenter.service;

import com.baomidou.mybatisplus.extension.service.IService;
import com.szx.usercenter.domain.FilePan;
import com.szx.usercenter.util.FileUploadEnum;
import com.szx.usercenter.util.Response;
import org.springframework.web.multipart.MultipartFile;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.util.Date;

/**
 * @author 25019
 * @description 针对表【file_pan】的数据库操作Service
 * @createDate 2024-06-02 18:55:24
 */
public interface FilePanService extends IService<FilePan> {

    FileUploadEnum uploadChunkFile(
            MultipartFile chunkFile,
            String fileName,
            Long fileSize,
            String filePid,
            Integer chunkNum,
            Integer totalChunks,
            HttpServletRequest request);

    Response getFileList(String fileNameString, Date updateTime, HttpServletRequest request);

    boolean addDir(FilePan filePan, HttpServletRequest request);

    void deleteFile(FilePan filePan, HttpServletRequest request);

    void preview(FilePan filePan, HttpServletResponse response);

    // 加载视频切片文件
    void readFileTs(String tsFileId, HttpServletResponse response);

    boolean renameFileName(FilePan filePan, HttpServletRequest request);

    void download(String fileId, HttpServletResponse response);

    boolean batchDelete(String fileIds, HttpServletRequest request);
}
